﻿namespace RBAC.Read.Api.MYSQL
{
    public static class ServiceCollectionExtensions
    {
        public static IServiceCollection AddMySqlBackupService(this IServiceCollection services, string connectionString, string mysqlDumpPath = "mysqldump", string mysqlPath = "mysql")
        {
            services.AddScoped<IDatabaseBackupService>(provider =>
            {
                var logger = provider.GetService<ILogger<MySqlBackupService>>();
                return new MySqlBackupService(connectionString, mysqlDumpPath, mysqlPath, logger);
            });

            return services;
        }
    }
}
